/*
 *@Description: 书籍信息
 *@Author: panlua
 *@Date: 2019-07-01 17:19:53
*/

const mongoose = require('mongoose')
const Schema = mongoose.Schema

const bookInfoSchema = new Schema({
  // _id: mongoose.Types.ObjectId(id),
  title: { // 名称
    type: String,
    required: true
  },
  majorCate: { // 一级分类
    type: String
  },
  shortIntro: { // 介绍
    type: String
  },
  minorCate: { // 二级分类
    type: String
  },
  author: { // 作者
    type: String,
    required: true
  },
  cover: { // 封面
    type: String
  },
  tags: { // 标签
    type: Array
  },
  buzz: { // 人气
    type: Number,
    default: 0
  }
})

module.exports = mongoose.model('BookInfo', bookInfoSchema, 'bookInfo')